package com.hiro.framework.tilegame.view;

import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;

import com.egghiro.framework.j2se.game.core.view.canvas.SGameCanvas;
import com.egghiro.framework.j2se.game.core.view.window.GameFrame;
import com.egghiro.framework.j2se.game.utils.PropertyUtils;
import com.hiro.framework.tilegame.constant.STileGameSystemConst;

public class STileGameFrame extends GameFrame {

    public STileGameFrame(final SGameCanvas canvas) {
        super(canvas);
        String title = PropertyUtils.getSystemPropertyValue(STileGameSystemConst.PROPERTY_TITLE);
        if(title == null){
            title = STileGameSystemConst.DEFAULT_TITLE;
        }
        this.setTitle(title);
        addComponentListener(new ComponentAdapter() {
            @Override
            public void componentResized(ComponentEvent componentevent) {
                canvas.updateDoubleBuffer();
            }
        });
    }

}
